home *** CD-ROM | disk | FTP | other *** search
- @2}SCROLL ROUTINE
-
-
-
- @3(Converted by Thomas Lancaster "Editor of MAG.E" from a
- message originally posted in the AMOS echo of Fidonet).
-
- @1
- >How is it possible to set a scroll routine going in the foreground
- >and have other things happening in the foreground.
-
- @4
- The only way you can do such a thing and leave it alone so that you can do
- other things, is to use interrupts. Seeing as you don't have much control
- over interrupts from AMOS, you cannot do it (normally). However, AMOS has
- AMAL, which DOES support interrupts (50 frames second).
- @1
- I'd suggest that you do the following:
- @4
- Open a large screen, like 960x256 or something. Then plot your scroll text
- onto the screen normally and wrap it around onto the next line when you get
- to 960-320 (320 is the display area size)...
-
- @5
-
-
-
-
-
- +-----------------------------------+-------------+
- |This is a test scroll text which will wrap around|
- |ll wrap around to the next line once you have rea|
- |e you have reached the end of the screen. By doin|
- |creen. By doing this you can use hardware scrolli|
- |rdware scrolling from AMAL - which will run on it|
- |will run on its own in the background, while you |
- |nd, which will run on its own while you do other |
- | you do other things. |
- +-----------------------------------+-------------+
- | ^
- | /|\
- |______\____________________________|
- / [Display size ]
- Copy
- from
- here - - - - - - - - - - - - - - - -To here
-
- @4
- Basically, if you want your screen (on the actual screen - what you can see)
- to be 320, then you subtract that from 960 (the screen width). That gives
- you 960-320 which is 640. Now, you plot your scroll text (in its entirity)
- on the screen, making sure that you wrap around to the next 'line' when you
- get to 640. How you do this wrapping around is up to you. If you get stuck,
- I will explain that part further. By 'line', i mean the next 'text' line. If
- your text is 8 pixels high, then the next line starts 8 pixels lower than
- the last one. Basically, what you will end up with is a screen full of text
- - a continuous message which wraps round when it reaches 640. Then you do
- the following instruction:
- @1
- Screen Copy Screen, 0, 0, 640, 256 To 0, 640, 0
- @4
- which will copy the text from the left of the screen to position 640. This
- is necessary for the scrolling, because you want the scrolling to be
- seamless, and if you just jumpted to the next line when you reached the end
- of a line the text on-screen would suddelny get wiped and replaced with the
- next line.
-
- Now..
- @1
- Screen Display Screen, 128, YLine, 320, TextHeight
-
- @4
- Where 'YLine' is the hardware line on which you want the text to be
- vertically (42 is the top of the screen), and 'TextHeight' is the height of
- each text line - maybe 8, maybe more - just enough to display the first line
- of text.
-
- Then you do your amal.
-
- @1
- Channel 1 to Screen Offset Screen
-
- @4
- - Where 'Screen' is the number of the screen (as in the previous
- instructions).
-
-
- @1
- A$="For R0=0 To 255 Step 8; For R1=4 To 640 Step 4;"
- A$=A$+"Let X=R1; Let Y=R0; Pause; Next R1; Next R0;"
- Amal 1,A$
- Amal On
- @4
-
-
-
-
-
-
-
-
-
- That will start the text scrolling. 'Step 8' is the height of a text
- line. 'R1=4' and 'Step 4' is the scroll speed. If you change 1, make sure
- you change the other. A scroll speed which is not exactly divisable by 640
- wont work. That's it, that should work.
-
- @5
- Paul West
-
- @1
- End.
-